﻿@{
    ViewBag.Title = "角色分配";
    ViewBag.FirstPage = "组织架构管理";
    ViewBag.LastPage = "角色管理";
    Layout = "~/Views/MasterPage.cshtml";
}
<style>
    .am-btn-group am-btn-group-xs a:hover {
        color: #0094ff;
    }
</style>
<div class="am-g">
    <div class="am-u-md-6 am-cf">
        <div class="am-fl am-cf">
            <div class="am-btn-toolbar am-fl">
                <div class="am-btn-group am-btn-group-xs">
                    <button type="button" class="am-btn am-btn-default"><span class="am-icon-plus"></span>新增</button>
                </div>

                <div class="am-form-group am-margin-left am-fl">
                </div>
            </div>
        </div>
    </div>
    <div class="am-u-md-3 am-cf">
        <div class="am-fr">
            <div class="am-input-group am-input-group-sm">
                @*<input type="text" class="am-form-field">*@
                <span class="am-input-group-btn"></span>
            </div>
        </div>
    </div>
</div>
<div class="am-g">
    <div class="am-u-sm-12">
        <form class="am-form">
            <table class="am-table am-table-striped am-table-hover table-main">
                <thead>
                    <tr>
                        <th class="table-check">
                            @*<input type="checkbox">*@

                        </th>
                        <th class="table-id">编号</th>
                        <th class="table-title">角色</th>
                        <th class="table-date">操作时间</th>
                        <th class="table-set">操作</th>
                    </tr>
                </thead>
                <tbody>
                    @{
                        var roleList = new BLL.RoleManager().QueryRoleList();
                        if (roleList.Count != 0)
                        {
                            foreach (var item in roleList)
                            {
                        <tr>
                            <td>
                                @*<input type="checkbox">*@

                            </td>
                            <td>@item.Id</td>
                            <td><a style="color: #0094ff; cursor: pointer">@item.Name</a></td>
                            <td>@item.UpdateTime.ToString("yyyy-MM-dd HH:mm:ss")</td>

                            <td>
                                <div class="am-btn-toolbar">
                                    <div class="am-btn-group am-btn-group-xs">
                                        <a name="ModifyA" data-id="@item.Id" style="cursor:pointer">编辑</a>&emsp;
                                                <a name="AuthorA" data-id="@item.Id" style="cursor:pointer">权限</a>

                                    </div>
                                </div>
                            </td>
                        </tr>
                            }
                        }
                  
                    }

                </tbody>
            </table>
            <div class="am-cf">
                <div class="am-fr">
                </div>
            </div>
            <hr>
        </form>
    </div>

</div>
<script src="/Scripts/jquery-3.4.1.min.js"></script>
<script src="/Source/layui/layui.all.js"></script>
<script src="/Source/layui/layui.js"></script>
<link href="/Source/layui/css/layui.css" rel="stylesheet" />
<script>

    $(function () {
        $("a[name='AuthorA']").click(function () {
            layer.open({
                type: 2,
                title: "权限分配",
                fixed: false, //不固定
                maxmin: true,
                area: ['750px', '550px'],
                content: "/Mechanism/Menu/" + $(this).attr("data-id")  //菜单弹窗
            });
        });
    });
</script>
